package com.kotlin.android.simple.simple

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.kotlin.android.core.BaseActivity
import com.kotlin.android.ktx.ext.KEY_PATH
import com.kotlin.android.ktx.ext.KEY_SCREEN_HEIGHT
import com.kotlin.android.ktx.ext.KEY_SCREEN_WIDTH
import com.kotlin.android.ktx.ext.VariableExt
import com.kotlin.android.ktx.ext.ViewExt.onClick
import com.kotlin.android.ktx.utils.LogUtils
import com.kotlin.android.router.RouterManager
import com.kotlin.android.router.path.RouterActivityPath
import com.kotlin.android.simple.R
import kotlinx.android.synthetic.main.act_login.*

/**
 * 创建者: zl
 * 创建时间: 2020/6/9 9:05 AM
 * 描述:
 */
@Route(path = RouterActivityPath.User.PAGER_LOGIN)
class LoginActivity : BaseActivity() {
    @JvmField
    @Autowired
    var path: String? = ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.act_login)
        path = intent.getStringExtra(KEY_PATH)
//        LogUtils.e("path   $path")
//        LogUtils.e("" + intent.getIntExtra(KEY_SCREEN_WIDTH, 0))
//        LogUtils.e("" + intent.getStringExtra(KEY_SCREEN_HEIGHT))
        LogUtils.d("" + intent.extras)

        signBtn.onClick {
            VariableExt.isLogin = true
            RouterManager.navigation(path, intent.extras)
//            ARouter.getInstance().build(path)
//                .with(intent.extras)
//                .navigation()
            finish()
        }
    }
}